# !/usr/bin/env python
# coding=utf-8
# @Time    : 2017/12/21 15:35
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/wx_server_prototype.git
# @File    : token.py
# @Software: PyCharm
# @Version: 3.5.4
from flask import request
from configs import current_config
from . import api
from app.service import token_service

# token_service.get_server_access_token2(True)
@api.route(current_config.API_PREFIX + '/token/server_access_token', methods=['GET'])
def get_server_access_token():
	return token_service.get_server_access_token2()


@api.route(current_config.API_PREFIX + '/token/web_access_token', methods=['GET'])
def get_web_access_token():
	code = request.args.get('code')
	return token_service.get_web_access_token(code)
